package ds.recursive;

import ds.util.GeneralApp;

public class Triangle {

	public static long triangle(long n) {
		if( n > 1)
			return n + triangle(n-1);
		else
			return 1;
	}
	
	public static void main(String[] args) throws Exception
	{
		System.out.print("请输入阶数：");
		int i = GeneralApp.getInt();
		System.out.println(triangle(i));
	}
}